1. Field of the Invention
The invention relates to an apparatus and method for software monitoring.
2. Related Art
A computer controlled system runs in accordance with software stored in program memory. In order to maintain the integrity of the system, the execution of software by the computer must be effective and efficient. Ordinarily, as the computer executes the software, the original software language in which the program is composed, or source code, is converted by a compiler into a lower level, i.e. less abstract, mnemonic language, machine language or object code. The source code is converted into mnemonic language (object code) because the processors in a computer controlled system cannot act immediately on the source code. Rather the processor can only act on the object code. After the computer converts the source code to object code, the processor initiates and takes action on its three principal buses, the address bus, data bus, and control bus, to perform the functions required by the source code. The address bus is an internal electronic channel interconnecting the processor to a random access memory (RAM) along which the addresses of memory storage locations are transmitted to identify which code stored in memory will come into play during execution. Data is sent back and forth between the memory and the processor. The control bus carries the output signals used to control the apparatus being controlled by the processor.
Sometimes, the output at the processor does not match the function for which the source code coded. This can occur when so-called "wild-write errors", "execution leg errors", "logical flow errors", or other "bugs" occur in the control software. Errors are not always apparent from the output. Even when a problem is shown in the final output, the output does not reveal where in the source code the error occurred or if there is a compiling error. System faults or system behavior errors adversely affect the quality of the entire system; therefore, it is important to monitor execution of software to ascertain software efficiency and to identify and diagnose software bugs or other errors in the code so they may be removed from the program.
Existing software monitoring is achieved by sections of diagnostic code in the software program itself monitoring its execution. However, underlying software malfunctions can cause the diagnostic software to also malfunction. Other software diagnostic programs, referred to as code coverage, or code profiling, programs, such as diagnostic programs known in the market as CASE, QFD, SEI, and VFSM, perform diagnostics. Disadvantageously, because code coverage programs "instrument" the target object code by inserting diagnostic code or instructions into the source code being monitored, execution time is increased. As the computer software object code is read in sequential linear fashion, the diagnostic instructions inserted into the programs must also be read. For every line of code that the processor reads, the time needed to execute coded function adds to the total time of execution. While this increased execution time may be acceptable for off-line, or nonreal-time systems, this increased execution time is intolerable in many real-time systems.
Another problem with known code coverage programs is that they cannot be used in control systems in which the program is fully embedded in the processor memory such as is done with the processors used in many real-time control applications. Accordingly, no diagnostic code can be added into the embedded system and any attempt to exceed the capacity of the embedded program memory can cause the system to crash or cause a panic condition.
Circuit emulators are known which do not require insertions of diagnostic code into the code being monitored, but the output results are expressed only in object code and are therefore cumbersome to use. Also, in order for the circuit emulators to work, the processor being monitored, i.e. the target processor, has to be fully functional and operating.
Disadvantageously, in known monitors, monitoring is restricted to monitoring only one of a supervisor code and a user code so that problems arising from transfers between user code activity and supervisor code management activities are not readily detected.
Other disadvantages with known code coverage or monitors exst. Failure to precisely measure the elapsed time and time duration of functions being executed in real-time makes certain timing errors difficult to detect. The inability in known code monitors to maintain the actual waveform generated by the processor in order to detect hardware related problems is also lacking. Lack of sufficient memory to store large numbers of signals both before and after occurrence of trigger events also makes detection of programming errors more difficult.
The present invention is directed to overcoming or at least reducing the effects of one or more of the problems set forth above.